package com.yyj.controller;

import com.yyj.entity.Dept;
import com.yyj.entity.Result;
import com.yyj.service.PostsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/post")
public class PostsController {
    @Autowired
    PostsService postsService;

    @GetMapping
    public Result findPost() {
        List<Dept> list = postsService.findPost();
        return Result.success(list);
    }
}
